package goroutine

import (
	"fmt"
	"sync"
)

func WaitGroup(){

	//WaitGroup
	wg := &sync.WaitGroup{}
	wg.Add(2)

	go func() {
		fmt.Println("----------- 1 done")
		wg.Done()
	}()
	go func() {
		fmt.Println("----------- 2 done")
		wg.Done()
	}()


	wg.Wait()


	fmt.Println("***********main  continue")

}





